package com.llho.admin.product;

import com.llho.admin.BaseAction;
import com.llho.core.bo.ProductBo;
import com.llho.core.domain.Product;

public class DeleteAction  extends BaseAction{
	
	boolean isAccept = false;
	Long id;
	
	ProductBo productBo;
	// DI via Spring
	public void setProductBo(ProductBo productBo) {
		this.productBo = productBo;
	}
	
	public String execute(){
		if(isAccept){
			Product product = productBo.getById(id);
			productBo.delete(product);
			return redirect("listingProduct.llh");
		}
		return "success";
	}

	public void setAccept(boolean isAccept) {
		this.isAccept = isAccept;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
}
